package itheima.com.writer;

public class BufferedReader_ extends Reader_{

    private Reader_ reader;//属性是 Reader_类型

    public BufferedReader_(Reader_ reader) {
        this.reader = reader;
    }

//    public void readFile(){
//        reader.readFile();
//    }

    @Override
    public void read() {
        reader.read();
    }

    //    多次读取文件  让方法更灵活
    public void readFiles(int sum){
        for (int i = 0; i < sum; i++) {
            reader.readFile();
        }
    }

//    扩展readString，批量处理字符串数据
    public void readStrings(int sum){
        for (int i = 0; i < sum; i++) {
            reader.readStrings();
        }
    }


}
